package zeroj.web.core;

import zeroj.web.action.ActionHelper;
import zeroj.web.context.ValueStack;
import zeroj.web.dispatch.Dispatcher;
import zeroj.web.view.wrapper.HttpRequestWrapper;
import zeroj.web.view.wrapper.HttpResponseWrapper;

/**
 * 
 * @author LYL(lyl at gmail dot com)
 *
 * @since 1.0
 *
 * 2008-9-30
 */
public abstract class ActionSupport {

	public static final String SUCCESS = "success";
	
	public static final String INPUT = "input";
	
	public static final String ERROR = "error";

	protected final static HttpRequestWrapper getRequest() {
		
		return Dispatcher.getRequest();
	}
	protected final static HttpResponseWrapper getResponse() {
		
		return Dispatcher.getResponse();
	}
	protected final static ValueStack getValueStack() {
		
		return getRequest().getValueStack();
	}
	protected String getMessage(String key) {
		
		return ActionHelper.getMessage(getClass(), key);
	}
}
